module(
    name = "j2cl",
    version = "20250630",
    bazel_compatibility = [">=8.0.1"],
    repo_name = "com_google_j2cl",
)

bazel_dep(
    name = "protobuf",
    version = "31.0",
    repo_name = "com_google_protobuf",
)

# Adding this extra dep to work around error "Protobuf only supports C++17 and
# newer." in mac os.
# TODO(b/427495750): Remove this extra dep once the bug is fixed.
bazel_dep(
  name = "rules_cc",
  version = "0.0.17"
)

bazel_dep(
    name = "bazel_skylib",
    version = "1.7.1",
)

bazel_dep(
    name = "platforms",
    version = "0.0.5",
)

bazel_dep(
    name = "rules_kotlin",
    version = "1.9.6",
)

bazel_dep(
    name = "rules_license",
    version = "1.0.0",
)

bazel_dep(
    name = "rules_shell",
    version = "0.4.1",
    dev_dependency = True,
)

bazel_dep(
    name = "rules_python",
    version = "1.4.1",
)

bazel_dep(
    name = "rules_webtesting",
    version = "0.4.1",
    repo_name = "io_bazel_rules_webtesting",
)

bazel_dep(
    name = "rules_closure",
    version = "0.15.0",
    repo_name = "io_bazel_rules_closure",
)

bazel_dep(
    name = "google_bazel_common",
    version = "0.0.1",
)

bazel_dep(
    name = "rules_java",
    version = "8.6.1",
)

bazel_dep(
    name = "rules_jvm_external",
    version = "6.6",
)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

maven.install(
    artifacts = [
        "args4j:args4j:2.33",
        "com.google.j2objc:j2objc-annotations:1.3",
        "com.google.escapevelocity:escapevelocity:jar:1.1",
        "com.google.code.gson:gson:2.10.1",
        "org.eclipse.jdt:org.eclipse.jdt.core:jar:3.22.0",
        "org.eclipse.platform:org.eclipse.equinox.common:jar:3.12.0",
    ],
)

use_repo(maven, "maven")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_google_jsinterop_annotations-j2cl",
    sha256 = "1664bbfcbeb487b1169ae093b6f9f1c416bd681c91fa3ce52bd0e22968531140",
    strip_prefix = "jsinterop-annotations-4d2016afbf248b28cf3430c64d941326ea9ad0ad",
    urls = ["https://github.com/google/jsinterop-annotations/archive/4d2016afbf248b28cf3430c64d941326ea9ad0ad.zip"],
)

http_archive(
    name = "com_google_binaryen",
    build_file = "@com_google_j2cl//build_defs/internal_do_not_use/binaryen:BUILD.binaryen",
    patch_args = ["-p1"],
    patches = ["@com_google_j2cl//build_defs/internal_do_not_use/binaryen:generate_intrinsics.patch"],
    sha256 = "a3b0c6b4884cd147913088817f6e238e700394834a7cbd8610acd6b23bdd4860",
    strip_prefix = "binaryen-6645f0c05b8e9268f35742bb6b0a67e0a9c40795",
    url = "https://github.com/WebAssembly/binaryen/archive/6645f0c05b8e9268f35742bb6b0a67e0a9c40795.zip",
)
